package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.domain.JiajiaRecruitmentPosters;
import com.ruoyi.system.mapper.JiajiaRecruitmentPostersMapper;
import com.ruoyi.system.service.IJiajiaRecruitmentPostersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 招聘内容信息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-28
 */
@Service
public class JiajiaRecruitmentPostersServiceImpl implements IJiajiaRecruitmentPostersService
{
    @Autowired
    private JiajiaRecruitmentPostersMapper jiajiaRecruitmentPostersMapper;

    /**
     * 查询招聘内容信息
     *
     * @param id 招聘内容信息主键
     * @return 招聘内容信息
     */
    @Override
    public JiajiaRecruitmentPosters selectJiajiaRecruitmentPostersById(Long id) {
        return jiajiaRecruitmentPostersMapper.selectJiajiaRecruitmentPostersById(id);
    }

    /**
     * 查询招聘内容信息列表
     *
     * @param jiajiaRecruitmentPosters 招聘内容信息
     * @return 招聘内容信息
     */
    @Override
    public List<JiajiaRecruitmentPosters> selectJiajiaRecruitmentPostersList(JiajiaRecruitmentPosters jiajiaRecruitmentPosters)
    {
        return jiajiaRecruitmentPostersMapper.selectJiajiaRecruitmentPostersList(jiajiaRecruitmentPosters);
    }

    /**
     * 新增招聘内容信息
     *
     * @param jiajiaRecruitmentPosters 招聘内容信息
     * @return 结果
     */
    @Override
    public int insertJiajiaRecruitmentPosters(JiajiaRecruitmentPosters jiajiaRecruitmentPosters)
    {
        jiajiaRecruitmentPosters.setCreateTime(DateUtils.getNowDate());
        jiajiaRecruitmentPosters.setCreateBy(ShiroUtils.getLoginName());
        return jiajiaRecruitmentPostersMapper.insertJiajiaRecruitmentPosters(jiajiaRecruitmentPosters);
    }

    /**
     * 修改招聘内容信息
     *
     * @param jiajiaRecruitmentPosters 招聘内容信息
     * @return 结果
     */
    @Override
    public int updateJiajiaRecruitmentPosters(JiajiaRecruitmentPosters jiajiaRecruitmentPosters)
    {
        jiajiaRecruitmentPosters.setUpdateTime(DateUtils.getNowDate());
        return jiajiaRecruitmentPostersMapper.updateJiajiaRecruitmentPosters(jiajiaRecruitmentPosters);
    }

    /**
     * 批量删除招聘内容信息
     *
     * @param ids 需要删除的招聘内容信息主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaRecruitmentPostersByIds(String ids)
    {
        return jiajiaRecruitmentPostersMapper.deleteJiajiaRecruitmentPostersByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除招聘内容信息信息
     *
     * @param id 招聘内容信息主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaRecruitmentPostersById(Long id)
    {
        return jiajiaRecruitmentPostersMapper.deleteJiajiaRecruitmentPostersById(id);
    }

    @Override
    public JiajiaRecruitmentPosters selectJiajiaRecruitmentPosters() {
        return jiajiaRecruitmentPostersMapper.selectJiajiaRecruitmentPostersById(1L);
    }
}
